package com.ssi.myshop.contants;

import com.ssi.myshop.base.BaseData;
import com.ssi.myshop.base.BaseListData;
import com.ssi.myshop.bean.AddCarBean;
import com.ssi.myshop.bean.BannerBean;
import com.ssi.myshop.bean.CategoryBean;
import com.ssi.myshop.bean.CategoryContentBean;
import com.ssi.myshop.bean.DetailBean;
import com.ssi.myshop.bean.LoginBean;
import com.ssi.myshop.bean.RegisterBean;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface Api {
    /**
     * 注册
     */
    @POST("/tristan/user/username/register")
    Observable<BaseData<RegisterBean>> register(@QueryMap Map<String, Object> params);

    /**
     * 用户登录
     */
    @POST("/tristan/user/username/login")
    Observable<BaseData<LoginBean>> login(@QueryMap Map<String, Object> param);


    /**
     * 获取bannerList
     */
    @GET("/tristan/banner/list")
    Observable<BaseListData<BannerBean>> getBanner();


    /**
     * 获取分类列表
     *
     * @return
     */
    @GET("/tristan/shop/goods/category/all")
    Observable<BaseListData<CategoryBean>> getCategory();


    /**
     * 获取分类详情
     *
     * @return
     */
    @GET("/tristan/shop/goods/list")
    Observable<BaseListData<CategoryContentBean>> getCategoryContent();

    /**
     * 获取详情
     *
     * @param id
     * @return
     */
    @GET("/tristan/shop/goods/detail")
    Observable<BaseData<DetailBean>> getDetailById(@Query("id") int id);

    /**
     * 加入购物车
     *
     * @param params
     * @return
     */
    @POST("/tristan/shopping-cart/add")
    Observable<BaseData<AddCarBean>> addToCar(@QueryMap Map<String, Object> params);

//    @GET("/shopping-cart/info")
//    Observable
}
